/**
 * Created by will on 2017/9/22.
 */
$(function () {
    //引入公共部分
//    tab栏js
        $(".titTab li").click(function(){
            $(".titTab li").eq($(this).index()).addClass("order-active").siblings().removeClass("order-active");
            $(".titInfo .titInformation").hide().eq($(this).index()).show();
        });
    //分页js
    layui.use(['laypage', 'layer','form','laydate'], function() {
        var laypage = layui.laypage
            , layer = layui.layer
            ,form=layui.form
            ,laydate=layui.laydate;
        //form监听提交
        form.on('submit(demo1)', function(data){
            layer.alert(JSON.stringify(data.field), {
                title: '最终的提交信息'
            })
            return false;
        });
        //日期控件
        laydate.render({
            elem: '#date1'
            ,type:'datetime'
            ,theme: '#45a2ff'
        });
        laydate.render({
            elem: '#date2'
            ,type:'datetime'
            ,theme: '#45a2ff'
        });
        laydate.render({
            elem: '#date3'
            ,type:'datetime'
            ,theme: '#45a2ff'
        });
        laydate.render({
            elem: '#date4'
            ,type:'datetime'
            ,theme: '#45a2ff'
        });
        //分页
        laypage.render({
            elem: 'titpaging'
            ,count: 1000
            ,theme: '#45A2FF'
            ,prev: '<em><</em>'
            ,next: '<em>></em>'
            ,layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
            ,jump: function(obj){
                console.log(obj)
            }
        });
        laypage.render({
            elem: 'titpaging2'
            ,count: 1000
            ,theme: '#45A2FF'
            ,prev: '<em><</em>'
            ,next: '<em>></em>'
            ,layout: ['count','prev', 'page', 'next', 'limit', 'skip']
            ,jump: function(obj){
                console.log(obj)
            }
        });
        laypage.render({
            elem: 'titpaging3'
            ,count: 1000
            ,theme: '#45A2FF'
            ,prev: '<em><</em>'
            ,next: '<em>></em>'
            ,layout: ['count','prev', 'page', 'next', 'limit', 'skip']
            ,jump: function(obj){
                console.log(obj)
            }
        });
        laypage.render({
            elem: 'titpaging4'
            ,count: 1000
            ,theme: '#45A2FF'
            ,prev: '<em><</em>'
            ,next: '<em>></em>'
            ,layout: ['count','prev', 'page', 'next', 'limit', 'skip']
            ,jump: function(obj){
                console.log(obj)
            }
        });
    });
//    输入框js
$("#ordernew").click(function () {
    window.location.href="./easytrip-ordernew.html"
})
})